/**
 * 
 */
package cz.cvut.fit.bugtrac.publicmodel.dto.metadata;

import java.util.Date;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import cz.cvut.fit.bugtrac.publicmodel.dto.BaseDTO;

/**
 * data transfer object for Metadata (also JAXB bean)
 * 
 * @author Jarec
 * 
 */
@XmlRootElement(name = "metadata")
@XmlType(name = "metadata", propOrder = { "name", "description", "lastUpdate",
		"updateInterval", "authors" })
public class MetadataDTO extends BaseDTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;
	private String description;
	private Date lastUpdate;
	private Long updateInterval;
	private AuthorsDTO authors;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	@XmlElement(name = "name", required = true, nillable = false)
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	@XmlElement(name = "description", required = true, nillable = false)
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the lastUpdate
	 */
	public Date getLastUpdate() {
		return lastUpdate;
	}

	/**
	 * @param lastUpdate
	 *            the lastUpdate to set
	 */
	@XmlElement(name = "lastUpdate", required = true, nillable = false)
	public void setLastUpdate(Date lastUpdate) {
		this.lastUpdate = lastUpdate;
	}

	/**
	 * @return the updateInterval
	 */
	public Long getUpdateInterval() {
		return updateInterval;
	}

	/**
	 * @param updateInterval
	 *            the updateInterval to set
	 */
	@XmlElement(name = "updateInterval", required = true, nillable = false)
	public void setUpdateInterval(Long updateInterval) {
		this.updateInterval = updateInterval;
	}

	/**
	 * @return the authors
	 */
	public AuthorsDTO getAuthors() {
		return authors;
	}

	/**
	 * @param authors
	 *            the authors to set
	 */
	@XmlElement(name = "authors", required = true, nillable = false)
	public void setAuthors(AuthorsDTO authors) {
		this.authors = authors;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("MetadataDTO [name=");
		builder.append(name);
		builder.append(", description=");
		builder.append(description);
		builder.append(", lastUpdate=");
		builder.append(lastUpdate);
		builder.append(", updateInterval=");
		builder.append(updateInterval);
		builder.append(", authors=");
		builder.append(authors);
		builder.append("]");
		return builder.toString();
	}

}
